package net.meblabs.commons.progress;

public class ProgressState {

	public static final int UNKNOWN = -1;
	private int total;
	private int done;
	private String message;

	ProgressState(int total, String message) {
		this.total = total;
		this.message = message;
	}

	public int getTotal() {
		return total;
	}

	void setTotal(int total) {
		this.total = total;
	}

	public int getDone() {
		return done;
	}

	void setDone(int done) {
		this.done = done;
	}

	public int getDonePercent() {
		if (total > UNKNOWN) {
			return (int) (done * 100 / total);
		} else {
			return UNKNOWN;
		}
	}

	public String getMessage() {
		return message;
	}

	void setMessage(String message) {
		this.message = message;
	}
}
